<?php
class OORDBMySQLDatabase extends OORDBDatabase
{
	private $connection;
	private $name;
	
	public function __construct( OORDBMySQLConnection $connection, $name )
	{
		$this->connection = $connection;
		$this->name = $name;
	}
	
	public function getName()
	{
		return $this->name;
	}
	
	public function getConnection()
	{
		return $this->connection;
	}
	
	public function getTables()
	{
		$query = $this->connection->newSelectQuery();
		$query->setSQL( "SHOW TABLES FROM `" . $this->name . "`" );
		$query->execute();
		$databases = new ArrayObject();
		foreach ( $query as $row )
		{
			$values = array_values($row);
			$databases->append( new OORDBMySQLTable( $this, $values[0] ) );
		}
		return $databases->getIterator();
	}
}
?>